using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using DTO;
using DAO;
namespace BUS
{
    public enum ChiTietPhieuThanhLyBUSResult
    {
        OK,DAOERROR
    }
    public class ChiTietPhieuThanhLy
    {
        public static ChiTietPhieuThanhLyBUSResult Insert(DTO.PhieuThanhLySach ph , DTO.Sach s, DTO.LyDoThanhLy ld)
        {
            DAO.Interface dao = new DAO.ChiTietPhieuThanhLy();
            string sql = "insert into ChiTietPhieuThanhLy(MaPhieuThanhLy,MaSach,MaLyDo) values('";
            sql += ph.MaPhieuThanhLySach + "','";
            sql += s.MaSach + "','";
            sql += ld.MaLyDo + "')";
            if (!dao.Insert(sql))
                return ChiTietPhieuThanhLyBUSResult.DAOERROR;
            return ChiTietPhieuThanhLyBUSResult.OK;

        }

    }
}
